﻿using System;
using System.Collections.Generic;
using WB.Core.GenericSubdomains.Portable.Services;
using WB.Core.SharedKernels.DataCollection.Commands.Interview;
using WB.UI.Headquarters.Code.CommandTransformation;
using WB.UI.Shared.Web.CommandDeserialization;

namespace WB.UI.Headquarters.Services.Impl
{
    internal class SurveyManagementCommandDeserializer : CommandDeserializer
    {
        public SurveyManagementCommandDeserializer(ILogger logger) : base(logger)
        {
        }

        protected override Dictionary<string, Type> KnownCommandTypes => new()
        {
            { "CreateInterviewCommand", typeof(CreateInterviewControllerCommand) },
            { "DeleteInterviewCommand", typeof(DeleteInterviewCommand) },
            { nameof(ChangeInterviewModeCommand), typeof(ChangeInterviewModeCommand) },
            //assign
            { "AssignInterviewerCommand", typeof(AssignInterviewerCommand) },
            { "AssignSupervisorCommand", typeof(AssignSupervisorCommand) },
            { "AssignResponsibleCommand", typeof(AssignResponsibleCommand) },
            // flags and comments
            { "SetFlagToAnswerCommand", typeof(SetFlagToAnswerCommand) },
            { "RemoveFlagFromAnswerCommand", typeof(RemoveFlagFromAnswerCommand) },
            { "CommentAnswerCommand", typeof(CommentAnswerCommand) },
            // answer question
            { "AnswerDateTimeQuestionCommand", typeof(AnswerDateTimeQuestionCommand) },
            { "AnswerMultipleOptionsQuestionCommand", typeof(AnswerMultipleOptionsQuestionCommand) },
            { "AnswerNumericRealQuestionCommand", typeof(AnswerNumericRealQuestionCommand) },
            { "AnswerNumericIntegerQuestionCommand", typeof(AnswerNumericIntegerQuestionCommand) },
            { "AnswerSingleOptionQuestionCommand", typeof(AnswerSingleOptionQuestionCommand) },
            { "AnswerTextQuestionCommand", typeof(AnswerTextQuestionCommand) },
            { "AnswerGeoLocationQuestionCommand", typeof(AnswerGeoLocationQuestionCommand) },
            { "AnswerYesNoQuestion", typeof(AnswerYesNoQuestion) },
            // statuses
            { "ApproveInterviewCommand", typeof(ApproveInterviewCommand) },
            { "RejectInterviewCommand", typeof(RejectInterviewCommand) },
            { "RejectInterviewToInterviewerCommand", typeof(RejectInterviewToInterviewerCommand) },
            { "HqRejectInterviewToInterviewerCommand", typeof(HqRejectInterviewToInterviewerCommand) },
            { "HqRejectInterviewToSupervisorCommand", typeof(HqRejectInterviewToSupervisorCommand) },

            { "HqApproveInterviewCommand", typeof(HqApproveInterviewCommand) },
            { "HqRejectInterviewCommand", typeof(HqRejectInterviewCommand) },
            { "UnapproveByHeadquarterCommand", typeof(UnapproveByHeadquartersCommand) },

            //switch translation
            { "SwitchTranslation", typeof(SwitchTranslation) },
            
        };
    }
}
